package com.gdziarmaga.webshop.delivery.model;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import com.gdziarmaga.webshop.book.model.Book;

@Entity
@Table(name = "Delivery")
public class Delivery implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public static final String INVOICE_NUMBER = "invoice_number";
	public static final String SUPPLIER_NAME = "supplier_name";

	private long delivery_id;

	private String invoice_number;
	private String supplier_name;

//	private Set<BookDelivery> book_delivery_set = new HashSet<BookDelivery>();
	
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO, generator = "delivery_seq")
	@SequenceGenerator(name = "delivery_seq", sequenceName = "delivery_SEQ")
	@Column(name = "delivery_id", precision = 20, scale = 0, unique = true)
	public long getDelivery_id() {
		return delivery_id;
	}

	public void setDelivery_id(long delivery_id) {
		this.delivery_id = delivery_id;
	}

	@Column(name = "invoice_number", nullable = false, length = 20)
	public String getInvoice_number() {
		return invoice_number;
	}

	public void setInvoice_number(String invoice_number) {
		this.invoice_number = invoice_number;
	}

	@Column(name = "supplier_name", nullable = false, length = 100)
	public String getSupplier_name() {
		return supplier_name;
	}

	public void setSupplier_name(String supplier_name) {
		this.supplier_name = supplier_name;
	}

//	public void setBook_delivery_set(Set<BookDelivery> book_delivery_set) {
//		this.book_delivery_set = book_delivery_set;
//	}
//
//	@OneToMany(mappedBy = "delivery", cascade = CascadeType.ALL, fetch = FetchType.EAGER)
//	public Set<BookDelivery> getBook_delivery_set() {
//		return book_delivery_set;
//	}


}
